wx.cloud.init()
const db = wx.cloud.database()
const todosCollection = db.collection('data_stu')
Page({

  data: {
    password:"",
    stu_number:'',
    phone:'',
    address:'',
    statue:'',
  },

 
  formSubmit(e) {
    console.log('form发生了submit事件，携带数据为：', e.detail.value)
   let data = e.detail.value;
   console.log(data.stu_number);
    todosCollection.add({
      data:{
        stu_number:data.stu_number,
        password:data.password,
        phone:data.phone,
        address:data.address,
        statue:data.statue,
        
      }
    }).then(res => {
      wx.showModal({  
        content: '登记成功',
        showCancel: false,
        success(res) {}
      })
      console.log(res);
    })
  },
 
})